#ifndef _COOLANGAGE_VISITOR_H_
#define _COOLANGAGE_VISITOR_H_

#include <iostream>
namespace COOLangage {
  class VisitorExpression;
  class VisitorResult;
}
#include "Expression.h"

namespace COOLangage {
  
  class VisitorResult {
  protected:
    bool hres;
  public:
    VisitorResult(bool r = false) : hres(r) { }
    virtual ~VisitorResult() throw() { }
    inline bool hasResult() const { return hres; }
  };
  
  
  class VisitorExpression {
  protected:
    VisitorExpression() { }    
  public:
    virtual ~VisitorExpression() throw() { }
        
    virtual VisitorResult visitExpression(Expression *e) = 0;
    virtual VisitorResult visitAppel(Appel *app)  = 0;
    virtual VisitorResult visitLitEntier(LitEntier *ope) = 0;
    virtual VisitorResult visitLitFlottant(LitFlottant *ope) = 0;
    virtual VisitorResult visitVariable(Variable *var) = 0;    
    virtual VisitorResult visitOperateur(Operateur *ope) = 0;
    virtual VisitorResult visitOperateurUnaire(OperateurUnaire *ope) = 0;
    virtual VisitorResult visitOperateurBinaire(OperateurBinaire *ope) = 0;
  };  
}

#endif
